<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no" />
	<title>速翔网络</title>
	<link rel="stylesheet" type="text/css" href="../c/aui.css" />
	<style>
		body {
			background: #f8f8f8;
		}
		.aui-btn img {
			width: 0.75rem;
		}
		.aui-title {
			/*color: #222;*/
		}
		#tags{
			display: flex;
			justify-content:space-between;
			align-items: center;
			color: #222;
			padding: 0rem 0.75rem;
			margin-bottom: 0.5rem;
			background: #ececec;
			-webkit-transition: all .3s;
			transition: all .3s;

		}
		#tags div{
			border-bottom: 1px solid #ececec;
			padding: 0.5rem 0;
			font-size: 0.65rem;
		}
		#tags .a{
			color: #FE2C55;
			-webkit-transition: all .3s;
			transition: all .3s;
			border-bottom: 1px solid #FE2C55;
		}
	</style>
</head>

<body>
	<header class="aui-bar aui-bar-nav" id="sx-header">
		<a class="aui-pull-left aui-btn" tapmode onclick="_close()"><img src="../i/x.png" /></a>
		<div class="aui-title">管理订单</div>
	</header>
	<div id="tags">
		<div class="a" tapmode onclick="a(this)" data-id="0">全部订单</div>
		<div tapmode onclick="a(this)" data-id="1">未付款</div>
		<div tapmode onclick="a(this)" data-id="2">已付款</div>
		<div tapmode onclick="a(this)" data-id="3">已发货</div>
		<div tapmode onclick="a(this)" data-id="4">已结束</div>
		<div tapmode onclick="a(this)" data-id="5">已退款</div>
	</div>
</body>
<script type="text/javascript" src="../j/api.js"></script>
<script type="text/javascript">
	apiready = function() {
		var hide = ["","-1",1,2,3,4];
		var frames = [];
		var len = $('#tags div').length;
		for (var i = 0; i < len; i++) {
			var frame = {};
			frame.name = 'shop_member_dingdan_' + i;
			frame.url = _h_w + 'shop_member_dingdan.html';
			frame.pageParam = {
				i : i,
				hide:hide[i]
			};
			frames.push(frame);
		}
		openFrameGroup(frames)
	}
	function openFrameGroup(frames) {
		var header = $api.byId('sx-header');
		$api.fixStatusBar(header);
		var headerPos = $api.offset(header);
		var body_h = api.frameHeight;
		var asdasd = body_h - headerPos.h -  $('#tags').height()
		api.openFrameGroup({
			name : 'shop_member_dingdan',
			scrollEnabled : true,
			bounces : true,
			rect : {
				x : 0,
				y : headerPos.h +  $('#tags').height(),
				w : 'auto',
				h : asdasd,
			},
			index : 0,
			frames : frames,
			preload : 0,	// 预加载的 frame 个数，默认加载当前页后面一个
		}, function(ret, err) {
				$('.a').removeClass('a');
				$('#tags div').eq(ret.index).addClass('a');

		});
	}
	function a(_this){
		$('.a').removeClass('a');
		$(_this).addClass('a');
		api.setFrameGroupIndex({
			name : 'shop_member_dingdan',
			index : $(_this).data('id'),
			scroll : true, //是否平滑滚动至目标窗口，即是否带有动画
		});
	}
</script>

</html>
